package com.tepth.appmanageservice.protocol.bodys.aes;

import com.tepth.appmanageservice.protocol.Index;
import com.tepth.appmanageservice.protocol.interfaces.IReceive;
import com.tepth.appmanageservice.tools.ext.ExtToInt;

public class AesReply implements IReceive {
	public static final short ID = 0x0F06;

	private short length;
	private short reply_serial_number;
	private byte value;

	public short getReply_serial_number() {
		return this.reply_serial_number;
	}

	public void setReplySerialNumber(short reply_serial_number) {
		this.reply_serial_number = reply_serial_number;
	}

	public byte getValue() {
		return this.value;
	}

	public void setValue(byte value) {
		this.value = value;
	}

	@Override
	public short getLength() {
		return this.length;
	}

	@Override
	public void setLength(int len) {
		this.length = (short) len;
	}

	@Override
	public void Receive(byte[] data, Index index) {
		this.reply_serial_number = ExtToInt.fromByteArrayTo16(data, index);
		this.value = data[index.get()];
	}
}